package com.example.video.video_server.controller;

import com.example.video.common.util.ResponseWrap;
import com.example.video.common.util.ResponseWrapUtil;
import com.example.video.video_server.service.IHotVideoCountService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/video")
public class HotVideoCountController {

    @Autowired
    private IHotVideoCountService iHotVideoCountService;

    @GetMapping("/hot/list")
    @ApiOperation(value = "通过父类别获取热门视频和排行列表")
    public ResponseWrap getHotList(Integer categoryParentId){
        List res = iHotVideoCountService.getHotList(categoryParentId);
        return ResponseWrapUtil.success(res);
    }
}
